<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta charset="utf-8" />
	<title>后台管理 - 订单管理</title>

	<meta name="keywords" content="{$Think.CONFIG.keywords}" />
	<meta name="description" content="{$Think.CONFIG.description}" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
	<link rel="stylesheet" href="__PUBLIC__/css/page.css">
	<style>
		.header_top_position{position: fixed;top: 0;width: 150%;z-index: 999}
		#num{
			position: absolute;top: 1px;left: 70px;background: #9585bf;color: #fff;padding: 1px 6px;border-radius: 23px;
		}
	</style>
	<include file="Public/head" />
</head>
<?php $Order='active';$ptitle='订单管理';$title='列表';?>
<body class="no-skin">
<include file="Public/header" />
<div class="main-container" id="main-container">
	<script type="text/javascript">
		try{ace.settings.check('main-container' , 'fixed')}catch(e){}
	</script>

	<include file="Public/sidebar" />
	<div class="main-content">
		<div class="main-content-inner">
			<!-- #section:basics/content.breadcrumbs -->
			<include file="Public/breadcrumbs" />

			<!-- /section:basics/content.breadcrumbs -->
			<div class="page-content">
				<include file="Public/set" />

				<!-- /section:settings.box -->
				<div class="row">
					<div class="col-xs-12">
						<!-- PAGE CONTENT BEGINS -->
						<div class="col-xs-12 col-sm-1">
							<a href="{:U('index')}?final_payment_order=1" class="btn btn-xs all-btn btn-purple" type="button">
								尾款待处理<neq name="final_payment_order_count" value="0">&nbsp;&nbsp;&nbsp;+{$final_payment_order_count}</neq>
							</a>
						</div>
						<form name="admin_list_sea" class="form-search form-horizontal" method="get" action="{:U('index')}">
							<div class="row maintop">
								<!--搜索功能-->
								<div class="col-xs-12 col-sm-4">
									<select name="order_status">
										<option value="">订单状态</option>
										<option value="-1" <if condition="$opentype_check eq -1">selected</if>>已取消</option>
										<option value="-2" <if condition="$opentype_check eq -2">selected</if>>已删除</option>
										<option value="0" <if condition="$opentype_check eq '0'">selected</if>>待支付</option>
										<option value="1" <if condition="$opentype_check eq 1">selected</if>>待发货</option>
										<option value="2" <if condition="$opentype_check eq 2">selected</if>>待收货</option>
										<option value="3" <if condition="$opentype_check eq 3">selected</if>>已收货</option>
										<option value="4" <if condition="$opentype_check eq 4">selected</if>>申请换货</option>
										<option value="5" <if condition="$opentype_check eq 5">selected</if>>确认换货</option>
										<option value="6" <if condition="$opentype_check eq 6">selected</if>>已换货</option>
										<!--<option value="7" <if condition="$opentype_check eq 7">selected</if>>申请退货</option>-->
										<!--<option value="8" <if condition="$opentype_check eq 8">selected</if>>确认退货</option>-->
										<!--<option value="9" <if condition="$opentype_check eq 9">selected</if>>已退货</option>-->
									</select>
									<select name="install_status">
										<option value="">安装状态</option>
										<option value="-1" <if condition="$install_check eq -1">selected</if>>未安装</option>
										<option value="1" <if condition="$install_check eq '1'">selected</if>>已安装</option>
									</select>
									<select name="final_payment_status">
										<option value="">尾款状态</option>
										<option value="1" <if condition="$final_payment_status_check eq 1">selected</if>>待处理</option>
										<option value="2" <if condition="$final_payment_status_check eq 2">selected</if>>已结清</option>
									</select>
								</div>
								<div class="col-xs-12 col-sm-3 btn-sespan">
									<div class="input-group">
									<span class="input-group-addon">
										<i class="ace-icon fa fa-check"></i>
									</span>
										<input type="text" name="search" class="form-control search-query admin_sea" value="{$search}" placeholder="输入需查询的订单编号/商品名/用户名" />
									<span class="input-group-btn">
										<button type="submit" class="btn btn-xs btm-input btn-purple">
											<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
											搜索
										</button>
									</span>
									</div>
								</div>
								<div class="input-group-btn">
									<a href="{:U('index')}">
										<button type="button" class="btn btn-xs all-btn btn-purple">
											<span class="ace-icon fa fa-globe icon-on-right bigger-110"></span>
											显示全部
										</button>
									</a>
								</div>
							</div>
						</form>
						<div class="space-4"></div>
						<div style="font-size: 15px; margin-bottom: 10px;">注：电工未同意的“就近安装”订单，系统会在<span style="color:red;">24小时</span>后默认抢单</div>
						<div class="row">
							<table class="table table-bordered ">
								<thead>
									<tr id="theadtr">
										<th class="tc" style="width: 10%;" colspan="2">商品 x 数量</th>
										<th class="tc" style="width: 4%;"><if condition="session('user_vip') eq 1">会员价<else />单价</if></th>
										<th class="tc" style="width: 2%;">运费</th>
										<th class="tc" style="width: 3%;">用户</th>
										<th class="tc" style="width: 3%;">订单状态</th>
										<th class="tc" style="width: 3%;">上门安装</th>
										<th class="tc" style="width: 3%;">安装方式</th>
										<th class="tc" style="width: 4%;">安装费</th>
										<th class="tc" style="width: 3%;">安装电工</th>
										<th class="tc" style="width: 3%;">电工确认</th>
										<th class="tc" style="width: 3%;">安装状态</th>
										<th class="tc" style="width: 3%;">尾款状态</th>
										<th class="tc" style="width: 5%;">总额</th>
										<th class="tc" style="width: 11%;">操作</th>
									</tr>
								</thead>
								<tbody>
								<style>
									.grouptd{position:relative;}
									.group{display:inline-block;width:100%;}
									.groupselect{position:absolute;top:0;left:0;width:100%;height:100%;border:0;}
								</style>
								<volist name="order_number_list" id="ol">
									<tr class="listhead">
										<td colspan="13">
											<p></p>
											下单时间：<span>{$ol.add_time}</span>
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单编号：<span>{$ol.order_number}</span>
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;物流单号：
											<span>
												<if condition="$ol['tracking_number'] neq ''">
													{$ol.tracking_number}
												<else />
													<span style="color:red;">暂无</span>
												</if>
											</span>
											<if condition="$ol['order_price'] neq $ol['count_price']">
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单原价：<span>{$ol.order_price}</span>
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;操作人：<span>{$ol.admin_name}</span>
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;操作时间：<span>{$ol.time}</span>
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;备注：<span style="color:red;">{$ol.text}</span>
											</if>
												&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="{:U('order_edit')}?order_number={$ol.order_number}" class="btn-zxc">编辑</a>
										</td>
									</tr>
									<volist name="ol['order_good_list']" id="gl" key="k">
										<tr class="" style="margin-top:15px;">
											<td class="order-address tc" style="width: 3%;">
												<span><img src="__ROOT__{$gl.good_picture}" style="width: 100%"></span>
											</td>
											<td class="order-address tl">
												<span>{$gl.good_name}</span>
												<span>x{$gl.num}</span>
											</td>
											<td class="actualMoney tc borderRight">
												￥{$gl['price']}
											</td>
											<if condition="($k eq 1) or ($gl.order_status gt 2)">
												<td class="tr actualMoney borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
												<if condition="$gl.order_status lt 3">
													包邮
												</if>
												</td>
											</if>
											<if condition="($k eq 1) or ($gl.order_status gt 2)">
												<td class="tc order-logistics-status borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
												<span> {$ol.username}</span>
												</td>
											</if>
											<if condition="($k eq 1) or ($gl.order_status gt 2)">
												<td class="tc order-logistics-status borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
												<switch name="gl['order_status']">
													<case value="-2"><span style="color:red;">已删除</span></case>
													<case value="-1">已取消</case>
													<case value="0">待支付</case>
													<case value="1">待发货</case>
													<case value="2">待收货</case>
													<case value="3">已收货</case>
													<case value="4">申请换货</case>
													<case value="5">确认换货</case>
													<case value="6">已换货</case>
													<case value="7">申请退货</case>
													<case value="8">确认退货</case>
													<case value="9">已退货</case>
												</switch>
												</td>
											</if>
											<if condition="($k eq 1) or ($gl['order_status'] gt 2)">
												<td class="tc order-logistics-status borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
												<if condition="$gl['is_install'] eq 1">
													<span>需要</span>
													<else />
													<span>不需要</span>
												</if>
												</td>
											</if>
											<if condition="($k eq 1) or ($gl['order_status'] gt 2)">
												<td class="tc order-logistics-status borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
												<if condition="$gl['install_type'] eq 1">
													<span>系统抢单</span>
													<else />
													<span>就近安装</span>
												</if>
												</td>
											</if>
											<if condition="($k eq 1) or ($gl['order_status'] gt 2)">
												<td class="tc order-logistics-status borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
												<if condition="($gl.order_status lt 3) and ($gl.is_install eq 1)">
													￥<lt name="ol['total_install_price']" value="$configInfo['min_install_price']">
													{$configInfo['min_install_price']}
													<else/>
													{$ol['total_install_price']}
													</lt>
												<elseif condition="$gl.is_install eq -1" />
													-- --
												<else />
													￥{$gl['install_price']}
												</if>
												</td>
											</if>
											<if condition="($k eq 1) or ($gl['order_status'] gt 2)">
												<td class="tc order-logistics-status borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
													<if condition="($gl['order_status'] egt 0) and ($gl['is_install'] eq 1) and ($gl['electrician_id'] neq 0) and ($gl['install_type'] eq 2)">
														{$ol.electrician_name}
													<elseif condition="($gl['order_status'] gt 0) and ($gl['is_install'] eq 1) and ($gl['electrician_id'] neq 0)"/>
														{$ol.electrician_name}
													<elseif condition="($gl['order_status'] gt 0) and ($gl['is_install'] eq 1) and ($gl['electrician_id'] eq 0)"/>
														<span style="color:red;">正在派单<span>
													<else />
														---
													</if>
												</td>
											</if>

											<if condition="($k eq 1) or ($gl['order_status'] gt 2)">
												<td class="tc order-logistics-status borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
												<if condition="$gl['electrician_confirm'] eq ''">
													<span>不需要</span>
													<elseif condition="$gl['electrician_confirm'] eq '-1'" />
													<span style="color:red;">未同意</span>
													<elseif condition="$gl['electrician_confirm'] eq 1" />
													<span style="color:green;">同意</span>
													<else />
													<span>待处理</span>
												</if>
												</td>
											</if>

											<if condition="($k eq 1) or ($gl['order_status'] gt 2)">
												<td class="tc order-logistics-status borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
												<if condition="($gl['install_status'] eq 1) AND ($gl['is_install'] eq 1)">
													<span>已安装</span>
												<elseif condition="($gl['install_status'] eq -1) AND ($gl['is_install'] eq 1)"/>
													<span>未安装</span>
												<else />
													-- --
												</if>
												</td>
											</if>
											<if condition="($k eq 1) or ($gl['order_status'] gt 2)">
												<td class="tc order-logistics-status borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
												<if condition="$gl['final_payment_status'] eq 1">
													<span style="color:red;">待处理</span>
												<elseif condition="$gl['final_payment_status'] eq 2"/>
													<span style="color:green;">已结清</sp	an>
												<else />
													未到期
												</if>
												</td>
											</if>
											<if condition="($k eq 1) or ($gl['order_status'] gt 2)">
												<td class="order-address tc borderRight" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
											<span>
												<if condition="$gl.order_status lt 3">
													￥{$ol['count_price']}
												<else />
													￥{$gl['good_small_total']+$gl['install_price']+$gl['freight']}
												</if>
											</span>
												</td>
											</if>
											<if condition="($k eq 1) or ($gl['order_status'] gt 2)">
												<td class="order-op tc listzx" style="border-bottom: 1px solid #f0f0f0!important;" <if condition="($gl.order_status lt 3) AND ($gl.order_status neq -2)">rowspan="{$ol.order_good_count}"</if>>
												<if condition="($gl['order_status'] eq -1)">
													<a href="{:U('order_del')}?on={$gl.order_number}&order_status={$order_status}&install_status={$install_status}&p={$p}" class="ajax-delete btn-zxc" data-info="确认删除该订单？">删除</a>
												<elseif condition="$gl['order_status'] eq 3"/>
													<a href="{:U('order_del')}?oc={$gl.order_id}&order_status={$order_status}&install_status={$install_status}&p={$p}" class="ajax-delete btn-zxc" data-info="确认删除该订单？">删除</a>
												<elseif condition="$gl['order_status'] eq 0"/>
													<a href="{:U('order_cancel')}?on={$gl.order_number}&order_status={$order_status}&install_status={$install_status}&p={$p}" class="ajax-delete btn-zxc" data-info="确认取消该订单？">取消订单</a>
												<elseif condition="$gl['order_status'] eq 1"/>
													<a href="{:U('delivery')}?on={$gl.order_number}&order_status={$order_status}&install_status={$install_status}&p={$p}" class="ajax-delete btn-zxc" data-info="确认发货？">确认发货</a>
												<elseif condition="$gl['order_status'] eq 2"/>
													<a class="rst-btn btn-zxc" href="{:U('confirm_receive')}?on={$gl.order_number}&order_status={$order_status}&install_status={$install_status}&p={$p}">确认收货</a>
												<elseif condition="($gl['order_status'] eq 4) OR ($gl['order_status'] eq 5) OR ($gl['order_status'] eq 6)"/>
													<a href="{:U('order_return_info')}?oc={$gl.order_id}&order_status={$order_status}&install_status={$install_status}&p={$p}" class="btn-zxc">换货信息</a>
												<elseif condition="$gl['order_status'] eq 8"/>
													<a class="rst-btn btn-zxc" href="{:U('order_refund')}?oc={$gl.order_id}&order_status={$order_status}&install_status={$install_status}&p={$p}">已退货</a>
												</if>
												<a class="rst-btn zxbtn" href="javascript:;">订单详情</a>
												<div class="listhover" style="display: none;right: 213px; width: 295px;">
													<p>订单编号：<span>{$gl['order_number']}</span></p>
													<neq name="gl['pay_time']" value="">
														<p>支付时间：<span>{$gl['pay_time']}</span></p>
													</neq>
													<neq name="gl['delivery_time']" value="">
														<p>发货时间：<span>{$gl['delivery_time']}</span></p>
													</neq>
													<neq name="gl['confirm_time']" value="">
														<p>收货时间：<span>{$gl['confirm_time']}</span></p>
													</neq>
													<p>收货人/电话：<span>{$ol['receiver']} {$ol['phone']} </span></p>
													<p>收货地址：<span>{$ol['province']}{$ol['city']}{$ol['county']}{$ol['town']}{$ol['detailed_address']}</span></p>
													<if condition="($ol['is_install'] eq 1) and ($ol['order_status'] gt 0) and ($ol['electrician_id'] neq 0)">
														<p>安装电工/电话：
															<span>{$ol['electrician_name']} {$ol['electrician_phone']}</span>
														</p>
														<if condition="($ol['electrician_name'] neq '') and ($ol['install_type'] eq 1)">
															<p>电工接单：<span>{$ol['grab_time']}</span></p>
														</if>
														<if condition="($ol['electrician_name'] neq '') and ($ol['install_type'] eq 2)">
															<p>电工确认：<span>{$ol['electrician_confirm_time']}</span></p>
														</if>
														<if condition="$ol['install_time'] neq ''">
															<p>完成安装：<span>{$ol['install_time']}</span></p>
														</if>
													</if>
													<neq name="gl['apply_return_time']" value="">
														<p>申请换货：<span>{$gl['apply_return_time']}</span></p>
													</neq>
													<neq name="gl['confirm_return_time']" value="">
														<p>确认换货：<span>{$gl['confirm_return_time']}</span></p>
													</neq>
													<neq name="gl['return_time']" value="">
														<p>实际换货：<span>{$gl['return_time']}</span></p>
													</neq>
													<div></div>
												</div>
												</td>
											</if>
										</tr>
									</volist>
								</volist>
								</tbody>
							</table>
							<div class="cf" style="margin-top: 100px;">
								<span class="pages">{$page}</span>
							</div>
						</div>
						<!-- PAGE CONTENT ENDS -->
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div><!-- /.page-content -->
		</div>
	</div><!-- /.main-content -->
	<include file="Public/footer" />

</div><!-- /.main-container -->

<include file="Public/footerjs" />
<!-- inline scripts related to this page -->

<script>
	$('.zxbtn').hover(function(){
		$(this).next().css('display','block')
	},function(){
		$(this).next().css('display','none')
	})
</script>

</body>
</html>
